<!DOCTYPE html>
<html>
    <head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!--360浏览器优先以webkit内核解析-->
	<title>主页</title>
	<link rel="shortcut icon" href="../favicon.ico">
	<link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link rel="stylesheet" href="__PUBLIC__/css/ace.min.css" />
	<link href="__PUBLIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
	<link href="__PUBLIC__/css/animate.css" rel="stylesheet">
	<link href="__PUBLIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__PUBLIC__/css/paging.css" rel="stylesheet">
	<link href="__PUBLIC__/Widget/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
	<style>
	    .col-xs-6-1{
		position:relative;min-height:1px;padding-right:15px;padding-left:15px;
		float:left;width:25%
	    }
	    .list-group-item{ border-top: 0 !important; border-bottom: 1px solid #e7eaec !important; }
	    .list-group-item:last-child{ border-bottom: 0px solid #e7eaec !important; }
	    /*.row{ margin-left: -10px; margin-right: -10px; }*/
	    .ibox{ min-height: 408px; }
	    .ibox table{ display: none; min-height: 281px; }
	    .text-right { text-align: right !important; }
	</style>
    </head>
    <body class="gray-bg">
	<div class="wrapper wrapper-content" >
	    <div class="row">
		<div class="col-sm-12">
		    <div class="row text-center">
			<div class="col-xs-2">
			    <div class="panel padder-v item">
				<div class="h1 text-info font-thin h1"><{$data.user_sum}></div>
				<span class="text-muted text-xs">今日用户增长量</span>
				<div class="top text-right w-full">
				</div>
			    </div>
			</div>
			<div class="col-xs-2">
			    <div class="panel padder-v item bg-info">
				<div class="h1 text-fff font-thin h1"><{$data.call_sum}></div>
				<span class="text-muted text-xs">今日通话增长量</span>
				<div class="top text-right w-full">
				</div>
			    </div>
			</div>
			<div class="col-xs-2">
			    <div class="panel padder-v item bg-primary">
				<div class="h1 text-fff font-thin h1"><{$data.money_out_sum}></div>
				<span class="text-muted text-xs">今日消费金额（单位：金币）</span>
				<div class="top text-right w-full">
				</div>
			    </div>
			</div>
			<div class="col-xs-2">
			    <div class="panel padder-v item bg-primary">
				<div class="h1 text-fff font-thin h1"><{$data.money_in_sum}></div>
				<span class="text-muted text-xs">今日收益金额（单位：金币）</span>
				<div class="top text-right w-full">
				</div>
			    </div>
			</div>
			<div class="col-xs-2">
			    <div class="panel padder-v item bg-primary">
				<div class="h1 text-fff font-thin h1"><{$data.money_recharge_sum}></div>
				<span class="text-muted text-xs">今日充值金额（单位：金币）</span>
				<div class="top text-right w-full">
				</div>
			    </div>
			</div>
			<div class="col-xs-2">
			    <div class="panel padder-v item bg-primary">
				<div class="h1 text-fff font-thin h1"><{$data.money_withdraw_sum}></div>
				<span class="text-muted text-xs">今日提现金额（单位：金币）</span>
				<div class="top text-right w-full">
				</div>
			    </div>
			</div>
		    </div>
		    <div class="row" id="index_cont">
			<!--			    <div class="col-sm-6">
							<div class="ibox">
							    <div class="ibox-title">
								<h5>收支明细表</h5>
								<div class="ibox-tools">
			
								</div>
							    </div>
							    <div class="ibox-content">
								<div class="project-list">
								    <table class="table table-striped table-bordered table-hover" id="sample-table">
									<thead>
									    <tr>
										<th width="200px">交易时间</th>
										<th width="200px">收支类目</th>
										<th width="300px">摘要</th>
										<th width="200px">收入（金币）</th>
										<th width="200px">支出（金币）</th>
										<th width="200px">余额（金币）</th>
									    </tr>
									</thead>
								    </table>
								</div>
							    </div>
							</div>
						    </div>-->
			<div class="col-sm-6">
			    <div class="ibox">
				<div class="ibox-title">
				    <h5>今日消费明细表</h5>
				    <div class="ibox-tools">

				    </div>
				</div>
				<div class="ibox-content">
				    <div class="project-list">
					<table class="table table-striped table-bordered table-hover" id="sample-table1">
					    <thead>
						<tr>
						    <th width="150px">交易时间</th>
						    <th width="200px">摘要</th>
						    <th width="120px" class="text-right">消费金额</th>
						    <th width="120px" class="text-right">余额</th>
						    <th width="80px"><{$app_name2}>号</th>
						    <th width="120px">昵称</th>
						</tr>
					    </thead>
					    <tbody v-if="balance_log_list1.length">
						<tr v-for="item in balance_log_list1">
						    <td>{{item.ctime}}</td>
						    <td>{{item.content_text}}</td>
						    <td class="text-right">{{item.money}}</td>
						    <td class="text-right">{{item.balance}}</td>
						    <td>{{item.user_id}}</td>
						    <td>{{item.user_name_text}}</td>
						</tr>
					    </tbody>
					    <tbody v-else>
						<tr><td colspan="10">没有找到记录</td></tr>
					    </tbody>
					</table>
					<div id="page1" class="page_div"></div>
				    </div>
				</div>
			    </div>
			    <div class="ibox">
				<div class="ibox-title">
				    <h5>今日充值明细表</h5>
				    <div class="ibox-tools">

				    </div>
				</div>
				<div class="ibox-content">
				    <div class="project-list">
					<table class="table table-striped table-bordered table-hover" id="sample-table2">
					    <thead>
						<tr>
						    <th width="150px">交易时间</th>
						    <th width="200px">摘要</th>
						    <th width="120px" class="text-right">充值金额</th>
						    <th width="120px" class="text-right">余额</th>
						    <th width="80px"><{$app_name2}>号</th>
						    <th width="120px">昵称</th>
						</tr>
					    </thead>
					    <tbody v-if="balance_log_list2.length">
						<tr v-for="item in balance_log_list2">
						    <td>{{item.ctime}}</td>
						    <td>{{item.content_text}}</td>
						    <td class="text-right">{{item.money}}</td>
						    <td class="text-right">{{item.balance}}</td>
						    <td>{{item.user_id}}</td>
						    <td>{{item.user_name_text}}</td>
						</tr>
					    </tbody>
					    <tbody v-else>
						<tr><td colspan="10">没有找到记录</td></tr>
					    </tbody>
					</table>
					<div id="page2" class="page_div"></div>
				    </div>
				</div>
			    </div>
			</div>
			<div class="col-sm-6">
			    <div class="ibox">
				<div class="ibox-title">
				    <h5>今日收益明细表</h5>
				    <div class="ibox-tools">

				    </div>
				</div>
				<div class="ibox-content">
				    <div class="project-list">
					<table class="table table-striped table-bordered table-hover" id="sample-table3">
					    <thead>
						<tr>
						    <th width="150px">交易时间</th>
						    <th width="200px">摘要</th>
						    <th width="120px" class="text-right">收益金额</th>
						    <th width="120px" class="text-right">余额</th>
						    <th width="80px"><{$app_name2}>号</th>
						    <th width="120px">昵称</th>
						</tr>
					    </thead>
					    <tbody v-if="balance_log_list3.length">
						<tr v-for="item in balance_log_list3">
						    <td>{{item.ctime}}</td>
						    <td>{{item.content_text}}</td>
						    <td class="text-right">{{item.money}}</td>
						    <td class="text-right">{{item.balance}}</td>
						    <td>{{item.user_id}}</td>
						    <td>{{item.user_name_text}}</td>
						</tr>
					    </tbody>
					    <tbody v-else>
						<tr><td colspan="10">没有找到记录</td></tr>
					    </tbody>
					</table>
					<div id="page3" class="page_div"></div>
				    </div>
				</div>
			    </div>
			    <div class="ibox">
				<div class="ibox-title">
				    <h5>今日提现明细表</h5>
				    <div class="ibox-tools">

				    </div>
				</div>
				<div class="ibox-content">
				    <div class="project-list">
					<table class="table table-striped table-bordered table-hover" id="sample-table4">
					    <thead>
						<tr>
						    <th width="150px">交易时间</th>
						    <th width="200px">摘要</th>
						    <th width="120px" class="text-right">提现金额</th>
						    <th width="120px" class="text-right">余额</th>
						    <th width="80px"><{$app_name2}>号</th>
						    <th width="120px">昵称</th>
						</tr>
					    </thead>
					    <tbody v-if="balance_log_list4.length">
						<tr v-for="item in balance_log_list4">
						    <td>{{item.ctime}}</td>
						    <td>{{item.content_text}}</td>
						    <td class="text-right">{{item.money}}</td>
						    <td class="text-right">{{item.balance}}</td>
						    <td>{{item.user_id}}</td>
						    <td>{{item.user_name_text}}</td>
						</tr>
					    </tbody>
					    <tbody v-else>
						<tr><td colspan="10">没有找到记录</td></tr>
					    </tbody>
					</table>
					<div id="page4" class="page_div"></div>
				    </div>
				</div>
			    </div>
			</div>
		    </div>
		</div>
	    </div>
	</div>

	<!-- 全局js -->

	<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
	<script src="__PUBLIC__/js/vue.js"></script>
	<script src="__PUBLIC__/js/paging.js"></script>
	<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
	<!-- 自定义js -->
	<script src="__PUBLIC__/js/content.js?v=1.0.0"></script>
	<script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
	<script src="__PUBLIC__/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Widget/webuploader/0.1.5/webuploader.min.js"></script>
	<!--	<script src="__PUBLIC__/js/jquery.dataTables.min.js"></script>
		<script src="__PUBLIC__/js/jquery.dataTables.bootstrap.js"></script>-->

	<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
	<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	<script>
	    var vm = new Vue({
		el: "#index_cont",
		data: {
		    balance_log_list: [],
		    balance_log_list1: [],
		    balance_log_list2: [],
		    balance_log_list3: [],
		    balance_log_list4: []
		}
	    });
	    var balance_log_url = "<{:U('getmessagedata','','shtml')}>";
	    var app_code = '<{$app_code}>';
	    var pagesize1 = 5;
	    var totalpage1 = 0;
	    var totalsize1 = 0;
	    var valid1 = 1;
	    getbalanceloglist1(1);
	    var pagesize2 = 5;
	    var totalpage2 = 0;
	    var totalsize2 = 0;
	    var valid2 = 1;
	    getbalanceloglist2(1);
	    var pagesize3 = 5;
	    var totalpage3 = 0;
	    var totalsize3 = 0;
	    var valid3 = 1;
	    getbalanceloglist3(1);
	    var pagesize4 = 5;
	    var totalpage4 = 0;
	    var totalsize4 = 0;
	    var valid4 = 1;
	    getbalanceloglist4(1);
	    function getbalanceloglist1(page) {
		$.ajaxSetup({
		    async: false
		});
		$.post(balance_log_url, {'page': page, 'pagesize': pagesize1, 'type': '1', 'app_code': app_code},
			function (data) {
			    $("#sample-table1").show();
			    if (data.ret == '1001') {
				if (!(data.total > 0)) {
				    return false;
				}
				vm.balance_log_list1 = [];
				for (var i = 0; i < data.data.length; i++) {
				    vm.balance_log_list1.push(data.data[i]);
				}
				totalsize1 = data.total;
				totalpage1 = parseInt(totalsize1 / pagesize1);
				var remainder = 0;
				if (totalpage1 <= 0) {
				    totalpage1 = 1;
				} else {
				    remainder = totalsize1 % pagesize1;
				}
				if (remainder > 0) {
				    totalpage1 += 1;
				}
				if (valid1) {
				    $("#page1").paging({
					totalPage: totalpage1,
					totalSize: totalsize1,
					callback: function (num) {
					    if (num < 1 || num > totalpage1) {
						return false;
					    }
					    getbalanceloglist1(num);
					}
				    });
				    valid1 = 0;
				}
			    }
			});
	    }
	    function getbalanceloglist2(page) {
		$.ajaxSetup({
		    async: false
		});
		$.post(balance_log_url, {'page': page, 'pagesize': pagesize2, 'type': '2', 'app_code': app_code},
			function (data) {
			    $("#sample-table2").show();
			    if (data.ret == '1001') {
				if (!(data.total > 0)) {
				    return false;
				}
				vm.balance_log_list2 = [];
				for (var i = 0; i < data.data.length; i++) {
				    vm.balance_log_list2.push(data.data[i]);
				}
				totalsize2 = data.total;
				totalpage2 = parseInt(totalsize2 / pagesize2);
				var remainder = 0;
				if (totalpage2 <= 0) {
				    totalpage2 = 1;
				} else {
				    remainder = totalsize2 % pagesize2;
				}
				if (remainder > 0) {
				    totalpage2 += 1;
				}
				if (valid2) {
				    $("#page2").paging({
					totalPage: totalpage2,
					totalSize: totalsize2,
					callback: function (num) {
					    if (num < 1 || num > totalpage2) {
						return false;
					    }
					    getbalanceloglist2(num);
					}
				    });
				    valid2 = 0;
				}
			    }
			});
	    }
	    function getbalanceloglist3(page) {
		$.ajaxSetup({
		    async: false
		});
		$.post(balance_log_url, {'page': page, 'pagesize': pagesize3, 'type': '3', 'app_code': app_code},
			function (data) {
			    $("#sample-table3").show();
			    if (data.ret == '1001') {
				if (!(data.total > 0)) {
				    return false;
				}
				vm.balance_log_list3 = [];
				for (var i = 0; i < data.data.length; i++) {
				    vm.balance_log_list3.push(data.data[i]);
				}
				totalsize3 = data.total;
				totalpage3 = parseInt(totalsize3 / pagesize3);
				var remainder = 0;
				if (totalpage3 <= 0) {
				    totalpage3 = 1;
				} else {
				    remainder = totalsize3 % pagesize3;
				}
				if (remainder > 0) {
				    totalpage3 += 1;
				}
				if (valid3) {
				    $("#page3").paging({
					totalPage: totalpage3,
					totalSize: totalsize3,
					callback: function (num) {
					    if (num < 1 || num > totalpage3) {
						return false;
					    }
					    getbalanceloglist3(num);
					}
				    });
				    valid3 = 0;
				}
			    }
			});
	    }
	    function getbalanceloglist4(page) {
		$.ajaxSetup({
		    async: false
		});
		$.post(balance_log_url, {'page': page, 'pagesize': pagesize4, 'type': '4', 'app_code': app_code},
			function (data) {
			    $("#sample-table4").show();
			    if (data.ret == '1001') {
				if (!(data.total > 0)) {
				    return false;
				}
				vm.balance_log_list4 = [];
				for (var i = 0; i < data.data.length; i++) {
				    vm.balance_log_list4.push(data.data[i]);
				}
				totalsize4 = data.total;
				totalpage4 = parseInt(totalsize4 / pagesize4);
				var remainder = 0;
				if (totalpage4 <= 0) {
				    totalpage4 = 1;
				} else {
				    remainder = totalsize4 % pagesize4;
				}
				if (remainder > 0) {
				    totalpage4 += 1;
				}
				if (valid4) {
				    $("#page4").paging({
					totalPage: totalpage4,
					totalSize: totalsize4,
					callback: function (num) {
					    if (num < 1 || num > totalpage4) {
						return false;
					    }
					    getbalanceloglist4(num);
					}
				    });
				    valid4 = 0;
				}
			    }
			});
	    }
	</script>
	<script>
//	    var public = '__PUBLIC__';
//	    var getmessagedataurl = "<{:U('getmessagedata','','')}>";
//	    load_sample_table(1);
//	    load_sample_table(3);
//	    load_sample_table(2);
//	    load_sample_table(4);
//	    function load_sample_table(type) {
//		jQuery(function ($) {
//		    oTable = $('#sample-table' + type).dataTable({
//			"order": [[0, "desc"]],
//			ajax: {
//			    async: false,
//			    url: getmessagedataurl,
//			    data: {'type': type},
//			    type: 'POST',
//			    dataSrc: ''
//			},
//			columns: [
//			    {"data": "ctime"},
//			    {"data": "content"},
//			    {"data": "money"},
//			    {"data": "balance"},
//			    {"data": "user_id"},
//			    {"data": "user_name"},
//			],
//			aLengthMenu: [[5, 10, 25, 50], [5, 10, 25, 50]],
//			"dom": 'lfrti<"toolbar">p',
//			"fnDrawCallback": function () {
//			    $('#redirect').keyup(function (e) {
//				if ($(this).val() && $(this).val() > 0) {
//				    var redirectpage = $(this).val() - 1;
//				} else {
//				    var redirectpage = 0;
//				}
//				oTable.fnPageChange(redirectpage);
//			    });
//			},
//			oLanguage: {
//			    "sLengthMenu": "每页显示 _MENU_ 条记录",
//			    "sZeroRecords": "没有检索到数据",
//			    "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
//			    "sInfoEmpty": "没有数据",
//			    "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
//			    "oPaginate": {"sFirst": "首页", "sPrevious": "前一页", "sNext": "后一页", "sLast": "尾页"},
//			    "sProcessing": "<img src=" + public + "/img/waiting.gif>"
//			}
//		    });
////		$("div.toolbar").html('<input type="text" class="form-control" id="redirect" placeholder="输入页码" style="width:80px;height:28px;float:right;padding: 4px 8px;"/>');
//		});
//	    }
	</script>
    </body>
</html>
